#ifndef _CommandCreator_H_
#define _CommandCreator_H_

#include <vector>
#include <string>
#include "CommandCreator.h"
#include "Commands.h"

class CommandCreator {
  std::vector<AbstractParser *> parsers;
public:
  AbstractCommand *getCommand(const std::string &commandText);

  CommandCreator() {
    parsers.reserve(5);
    parsers.push_back(new PrintParser());
    parsers.push_back(new LockParser());
    parsers.push_back(new UnlockParser());
    parsers.push_back(new EndParser());
    parsers.push_back(new AssignParser());
  }

  virtual ~CommandCreator() {
    for (unsigned int i = 0; i < parsers.size(); i++) {
      delete parsers[i];
    }
  }
};

#endif